# Python 2.6.4
# Project Euler, Problem 69
# Copyright 2010 Talha Zaman

def sieveprimes(limit):
    sieve = [0 for i in range(0, limit)]
    sieve[0] = sieve[1] = 1
    for i in range(2,limit):
        if sieve[i]: continue
        for j in range(2*i, limit, i):
            sieve[j] += 1
    return sieve
s = sieveprimes(1000000)
print s.index(max(s))
